// run: $exec < input
#include <iostream>
#include <string>

std::string a[4] = {
	"|#.#.#.#.#.#.#.#.#.#.#.|D|)",
	"|#.#.#.#.#.#.#.#.#.#.#.|.|",
	"|#.......................|",
	"|#.#.#.#.#.#.#.#.#.#.#.|.|)",
};

int main()
{
	std::cout << "+------------------------+\n";
	int n; std::cin >> n;
	for (int i = 0; i < n; i++) {
		int l = a[3].find('#');
		for (int j = 0; j < 4; j++)
			if (a[j][l] == '#') {
				a[j][l] = 'O';
				break;
			}
	}
	for (int i = 0; i < 4; i++)
		std::cout << a[i] << "\n";
	std::cout << "+------------------------+\n";
}

